<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var arr = [1, 2, 3];
        // var sum = 0;
        // arr.forEach(function (value, index, array) {
        //     console.log('每个数组元素' + value);
        //     console.log('每个元素的索引' + index);
        //     console.log('数组本身' + array);
        //     sum += value;//6
        // });

        // let result = arr.map((value, index, array) => {
        //     return value + '我';
        // })
        // console.log(arr);
        // console.log(result);

        var arr = [10, 30, 4];
        var flag = arr.some(function (value) {
            return value >= 20;
        });
        console.log(flag);//true

        let result = arr.every((value) => {
            return value >= 20;
        });
        console.log(result);

    </script>
</body>

</html>